package com.softhinker.ke24.unit3.model;

import java.io.Serializable;

public class ProfessionLevel implements Serializable {

	private static final long serialVersionUID = 1849800805217194487L;

	private int yearsOfInvestment = 0;
	private boolean inFinanceIndustry = false;
	
	public int getYearsOfInvestment() {
		return yearsOfInvestment;
	}
	public void setYearsOfInvestment(int yearsOfInvestment) {
		this.yearsOfInvestment = yearsOfInvestment;
	}
	public boolean isInFinanceIndustry() {
		return inFinanceIndustry;
	}
	public void setInFinanceIndustry(boolean inFinanceIndustry) {
		this.inFinanceIndustry = inFinanceIndustry;
	}
	
	@Override
	public String toString(){
		return "Years of investment : " + this.getYearsOfInvestment() + "\n"
				+ "Is in financial industry : " + this.isInFinanceIndustry();
	}
	
	public int getValue(){
		int value = 0;
		if(this.getYearsOfInvestment() <= 3){
			if(this.isInFinanceIndustry()){
				value = 2;
			} else{
				value = 1;
			}
		} else if(this.getYearsOfInvestment() > 3 && this.getYearsOfInvestment() <= 10){
			if(this.isInFinanceIndustry()){
				value = 4;
			} else{
				value = 3;
			}
		} else if(this.getYearsOfInvestment() > 10){
			value = 5;
		}
		
		return value;
	}
}
